Q I am writing a printer driver that will create
an EPS file for each page of a document. To do this, I need to
customize the General print panel. I basically need to eliminate the
dialog items displayed when the More Choices button is clicked(paper
feed, destination, etc.). I also need to change the Print button to a
Save button, so the user can choose a destination for the EPS file(s)
created. Can I eliminate the controls I don't want by modifying the
job collection from a printer driver? If so, how do I modify the
collection items to hide the unwanted controls, and what message do I
override to modify them? If this approach won't work, is there
another way (such as substituting my own General panel for the
default?)
A Currently, there is no mechanism in GX to
remove most panel items from the standard print panels. The reasoning
behind this is that from a user interface standpoint, the panels need
to remain the same across various drivers so every user gets the same
user experience. You can, however, grey out/disable certain items in
the print panel as well as customize the destination pop-up/OK button
to suit your needs.
In order to disable items in the print panel, you need to get the collection item of what you want to disable and set the locked attribute by calling SetCollectionItemInfo(). This will dim the item in the panel. (NOTE: Not all items are able to be dimmed.) Collection items are documented in Inside Macintosh: QuickDraw GX Environments and Utilities: . FYI, the Quality item is an exception to the dimming/elimination rule.... The Quality collection item (gxQualityTag = 'qual') whose structure is defined in GXPrinting.h, has a Boolean field called disableQuality. If your driver specifies this field as true, then the quality item will not appear at all.
In order to change the destination pop-up and modify the 'OK' button(you need to do both together) you need to override the GXHandleAltDestination message and add an Alternate Destination ('dsta') resource to your driver. The specific details of these items are documented in Technote 1028.
If none of this suits your needs, you can override the panel entirely (via GXJobPrintDialog) and create your own. This is really not a good idea from the user interface standpoint, but it will get the job done.
Technical
Support
Technical Q&A's
Previous Question |
Contents
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help